package com.yyh.domain;

import java.math.BigDecimal;

public class Goods {
    private String goodId;
    private String goodName;
    private BigDecimal price;
    private Integer number;

    public Goods() {
    }

    public Goods(String goodId, String goodName, BigDecimal price, Integer number) {
        this.goodId = goodId;
        this.goodName = goodName;
        this.price = price;
        this.number = number;
    }

    public String getGoodId() {
        return goodId;
    }

    public void setGoodId(String goodId) {
        this.goodId = goodId;
    }

    public String getGoodName() {
        return goodName;
    }

    public void setGoodName(String goodName) {
        this.goodName = goodName;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    @Override
    public String toString() {
        return "Goods{" +
                "goodId='" + goodId + '\'' +
                ", goodName='" + goodName + '\'' +
                ", price=" + price +
                ", number=" + number +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Goods goods = (Goods) o;

        if (goodId != null ? !goodId.equals(goods.goodId) : goods.goodId != null) return false;
        if (goodName != null ? !goodName.equals(goods.goodName) : goods.goodName != null) return false;
        if (price != null ? !price.equals(goods.price) : goods.price != null) return false;
        return number != null ? number.equals(goods.number) : goods.number == null;
    }

    @Override
    public int hashCode() {
        int result = goodId != null ? goodId.hashCode() : 0;
        result = 31 * result + (goodName != null ? goodName.hashCode() : 0);
        result = 31 * result + (price != null ? price.hashCode() : 0);
        result = 31 * result + (number != null ? number.hashCode() : 0);
        return result;
    }
}
